import { onMounted, ref } from "vue"
import { listRegion } from "../../../api/manage/region"
import { loadAllParams } from "../../../api/page"

export const useRegion = () => {
  const regionList = ref([])

  const getRegionList = async () => {
    const { rows } = await listRegion(loadAllParams)
    regionList.value = rows
  }

  onMounted(() => {
    getRegionList()
  })
  
  return {
    regionList
  }
}